﻿<!DOCTYPE html>
<html ng-app="myModule">
<head>
    <meta charset="UTF-8">
    <title>基本构造</title>
    <script src="../JS/angular.min.js"></script>
    <script type="text/javascript">
        var myModule = angular.module("myModule", []); // 第一个是模块的的名称 第二个表示这个Module依赖那些module 字符串数组
        myModule.controller('MyController', ['$scope', function ($scope) {
            $scope.greeting = {
                text: "Hello"
            }
            setTimeout(function () {
                alert('123');
                $scope.greeting.text = "abc";
                $scope.$apply();
                $scope.$apply(function () {
                    $scope.greeting.text = "ttt";
                })
            }, 1000);
        }]);
    </script>
</head>
<body>
    <div ng-controller="MyController">
        <input ng-model="greeting.text" />
        <p>{{greeting.text}},AngularJS</p>
        
    </div>

</body>
</html>
